//@author A0101119Y
#ifndef FILEWRITER_H
#define FILEWRITER_H

#include "FileMgr.h"

namespace Twentyfifth {
	class FileWriter : public FileMgr {
	protected:
		void writeTaskToFile(Task);
		void writeLineToFile(std::string label, std::string value);
		void writeLineToFile(std::string label, DateTime value);
		void writeLineToFile(std::string label, int value);
		void writeLineToFile(std::string label, bool value);
		void writeLineToFile(std::string label, Task::TaskType value);
		void writeLineToFile(std::string line);
		void terminateTaskInFile();
		std::string parseDateTimeToString(DateTime);
		std::string parseTaskTypeToString(Task::TaskType);
		std::string parseBoolToString(bool);
		std::string padNumberWithZero(int);
	public:
		FileWriter();
		FileWriter(std::string customFile);
		~FileWriter();
		Status writeTasksToFile(std::vector<Task>);
		void openFile(std::string fileName);
	};
}

#endif